import { fileURLToPath, URL } from "node:url";

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";

// https://vitejs.dev/config/

export default defineConfig({
  plugins: [vue(), vueJsx()],
  resolve: {
    alias: [
      {
        find: "@",
        replacement: fileURLToPath(new URL("src", import.meta.url)),
      },
      {
        find: "components",
        replacement: fileURLToPath(new URL("src/components", import.meta.url)),
      },
      {
        find: "store",
        replacement: fileURLToPath(new URL("src/store", import.meta.url)),
      },
      {
        find: "utils",
        replacement: fileURLToPath(new URL("src/utils", import.meta.url)),
      },
      {
        find: /^~/,
        replacement: fileURLToPath(new URL("", import.meta.url)),
      },
    ],
  },
});
